package com.iscreen.core.services.parser;

import java.io.Serializable;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.jms.MessageListener;

import com.iscreen.core.utils.jms.BaseMDB;
import com.iscreen.core.utils.jms.IScreenQueues;
import com.iscreen.utils.exceptions.IScreenException;

@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination", propertyValue = IScreenQueues.PARSER_QUEUE) })

public class ParserMDB extends BaseMDB implements MessageListener
{
	@EJB
	private Parser parser;

	@Override
	protected Object processMessage(Serializable message) throws IScreenException
	{
		ParseMessage parseMessage = (ParseMessage) message;
		parser.parse(parseMessage);
		return null;
	}
	
}
